﻿@using XStudio.WebFramework.Mvc.Extensions
@using XStudio.WebFramework.Support
<!DOCTYPE html>
<html>
<head>
    <title>
        @ViewBag.Title @(ViewBag.Title != Admin.MvcApplication.SystemName ? "-" + @Admin.MvcApplication.SystemName : "")
    </title>
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <link href="@Url.Content("~/Scripts/jquery.easyui/themes/default/easyui.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/site-new.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/icons.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/jquery.jqplot.min.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.8.3.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.easyui/jquery.easyui.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Common.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Extensions/jquery.easyui.windowExtension.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.easyui/locale/easyui-lang-zh_CN.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.jqplot.min.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $('#processBar').ajaxSend(function () {
                if ($(".datagrid-mask").length == 0)
                    $(this).show();
            }).ajaxStart(function () {
                //$(this).show();
            }).ajaxStop(function () {
                //$(this).hide();
            }).ajaxComplete(function () {
                $(this).hide();
            });

            $.ajaxSetup({
                cache: false
            });

            $.validator.setDefaults({
                errorClass: "tip-error",
                errorPlacement: function (error, element) {
                    error.prependTo(element.parents("td").next());
                    //error.appendTo(element.parents("td").next());
                }
            });

            // jQuery.validator增加时间验证
            jQuery.validator.addMethod("timeISO", function (value, element) {
                if (this.optional(element)) return true;
                try {
                    var strArray = value.split(" ");
                    var strDate = strArray[0].split("-");
                    var strTime = strArray[1].split(":");
                    var a = new Date(strDate[0], (strDate[1] - parseInt(1)), strDate[2], strTime[0], strTime[1], strTime[2]);
                    return a.getFullYear() > 0 && a.getMonth() > 0 && a.getDay() > 0;
                } catch (e) { }
                return false;
            }, "请输入正确的时间！");

            //高级搜索
            Common.BindAdvSearch();

            // 左侧块初始化
            $.each($(".left-menu"), function (i, n) {
                var leftMenuHeader = "<div class='pg-left-menu-header'> <span class='pg-left-menu-left'></span><span class='pg-left-menu-right'></span> <h3> " + $(n).attr("title") + "</h3> </div>";
                $(n).wrap("<div class='pg-left-menu'></div>");
                $(n).before(leftMenuHeader);
                //$(n).addClass("pg-leftmenu-body");
            });
            $(".pg-left").removeClass("hidden");

            // 设置最小高度
            var height = $(document).height() - 90 - $(".pg-footer").height() - 90;
            if ($(".pg-body").height() < height) {
                $(".pg-body").css("min-height", height);
            }

            $('#tabsMain').tabs({
                width: $('#tabsMain').parent().width() - 3
                //height: height
            });
        });
    </script>
</head>
<body>
    <div class="process" id="processBar" style="display: none;">
        <span>数据更新中……</span>
    </div>
    <noscript>
        <div style="position: absolute; z-index: 100000; height: 2046px; top: 0px; left: 0px;
            width: 100%; background: white; text-align: center;">
            抱歉，请开启脚本支持！
        </div>
    </noscript>
    <div class="pg-header">
        <h1>
            <img src="@Url.Content("~/Content/imgs/logo.png")" alt="@Admin.MvcApplication.SystemName" />
        </h1>
        <div class="dock">
            <div>
                @Html.ActionLink("修改密码", "ChangePassword", "Me", new { area = "Support" }, new { onclick = "$.createWin({ url: this.href, width: 500, height: 290, title: '修改密码' });return false;" })|@Html.ActionLink("退出", "Logout", "Start", new { area = "" }, null)
            </div>
        </div>
    </div>
    <div class="nav-global">
        <span class="nav-global-right"></span>
        <div class="account">
            <div> 
                欢迎您！@UserAppI.CurrentUser.UserName
            </div>
        </div>
        <div class="main-menu">
            <ul>
                @Html.WebPartButton("用户管理", "Index", "Start", new { area = "User" }, null)
                @Html.WebPartButton("产品管理", "Index", "Start", new { area = "Product" }, null)
                @Html.WebPartButton("系统管理", "Index", "Start", new { area = "Support" }, null)
                @Html.WebPartButton("系统设置", "Index", "Start", new { area = "Common" }, null)
            </ul>
        </div>
    </div>
    <div class="pg-body clearfix">
        <div class="pg-left hidden">
            @RenderSection("Left")
        </div>
        <div class="pg-right">
            @RenderBody()
        </div>
    </div>
    @*页尾*@
    <div class="pg-footer" style="line-height: 1.5em;">
        @Html.Raw(Admin.MvcApplication.SystemInfo) &nbsp;<a style="color: #A2A2A2" href="http://www.miitbeian.gov.cn/">
            闽ICP备09029437号-5
        </a>
    </div>
</body>
</html>
